﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Company.master" AutoEventWireup="true"
    CodeFile="Company_ADManage.aspx.cs" Inherits="Company_ADManage" %>

<%@ Import Namespace="Avatar.Model" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cph_Main" runat="Server">
    <div class="Dialog">
        <div class="Title">
            广告管理</div>
        <div class="Content">
            当前账户余额：<asp:Label ID="lbl_Balance" runat="server" />
            ￥
            <asp:GridView ID="gv_AD" runat="server" AutoGenerateColumns="False" CellPadding="4"
                ForeColor="#333333" GridLines="None" Width="100%">
                <RowStyle BackColor="#EFF3FB" />
                <Columns>
                    <asp:TemplateField HeaderText="广告位">
                        <ItemTemplate>
                            <%# ((ADCategory)Eval("ADCategory")).CategoryName%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="状态">
                        <ItemTemplate>
                            <%# Convert.ToBoolean(Eval("open"))==true?"进行中":"<span style='color:red;'>已停止</span>" %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="价格">
                        <ItemTemplate>
                            <%# GetPrice(new Guid(Eval("ID").ToString())).Price.ToString() %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="投放时间">
                        <ItemTemplate>
                            <%# Eval("StartDatetime")==null?"--":Eval("StartDatetime") %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="到期日期">
                        <ItemTemplate>
                            <%# Eval("OverDatetime")==null?"--":Eval("OverDatetime") %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="操作">
                        <ItemTemplate>
                            <asp:Button ID="btn_Pay" runat="server" Text="付款" CommandArgument='<%# Eval("ID") %>'
                                OnClick="btn_Pay_Click" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                <EmptyDataTemplate>
                    <table>
                        <tr>
                            <td class="th">
                                广告位
                            </td>
                            <td class="th">
                                状态
                            </td>
                            <td class="th">
                                价格
                            </td>
                            <td class="th">
                                投放时间
                            </td>
                            <td class="th">
                                到期日期
                            </td>
                            <td class="th">
                                操作
                            </td>
                        </tr>
                        <tr>
                            <td colspan="6" style="padding-bottom: 5%; padding-top: 5%; text-align: center;">
                                您目前没有投放任何广告
                            </td>
                        </tr>
                    </table>
                </EmptyDataTemplate>
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <EditRowStyle BackColor="#2461BF" />
                <AlternatingRowStyle BackColor="White" />
            </asp:GridView>
            <asp:Label ID="lbl_Error" runat="server" ForeColor="red" EnableViewState="false" />
        </div>
    </div>
</asp:Content>
